import 'package:flutter/material.dart';

import '../shared/shared.dart';

class AuthorBack extends StatelessWidget {
  final bool showText;
  final String text;

  const AuthorBack({Key? key, this.showText = false, this.text = ''})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Container(
          margin: const EdgeInsets.only(top: 10),
          child: InkWell(
              highlightColor: Colors.transparent,
              radius: 0,
              onTap: () => Navigator.pop(context, true),
              child: const Icon(Icons.arrow_back_ios,
                  size: 30, color: ColorConstants.themeColor)),
        ),
        Container(
            margin: const EdgeInsets.only(top: 10),
            child: Text(showText ? text : text,
                style: const TextStyle(color: ColorConstants.themeColor, fontSize: 24))),
        CommonWidget.rowWidth(width: 30),
      ],
    );
  }
}
